package com.lh.anno;

import com.lh.anno.validate.StateValidate;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;
@Documented //元注解，生成文档
@Target( ElementType.FIELD)//元注解
@Retention(RetentionPolicy.RUNTIME)//元注解，运行时生效
@Constraint(validatedBy = StateValidate.class)//校验类，需要自行创建，如StateValidate

public @interface State {
    //注解校验失效提示
    String message() default "请输入草稿或已发布";
    //校验组默认继承default
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}



